package com.pachiraframework.springcloud.spark.controller;


import java.util.Map;
import java.util.function.BiConsumer;

import org.apache.spark.api.java.JavaSparkContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.pachiraframework.springcloud.spark.service.WordCountService;


@RestController
@RequestMapping("/user/")
public class UserController {
	
	
	@Autowired
	private WordCountService service;
	
	@RequestMapping(value= {"asa"})
	public Integer asa(){
		Map<String, Integer> run = service.run();
		
//		run.forEach(new BiConsumer<String, Integer>() {
//
//			@Override
//			public void accept(String t, Integer u) {
//				// TODO Auto-generated method stub
//				System.out.println(t+"   "+u);
//			}
//
//			@Override
//			public BiConsumer<String, Integer> andThen(
//					BiConsumer<? super String, ? super Integer> after) {
//				// TODO Auto-generated method stub
//				return null;
//			}
//		});
		
		
		return 110;
	}
	
	
	
	

}
